#pragma once

#include "commandbase.h"
#include <osg/Referenced>
#include <QString>
#include "datatypedefine.h"
#include <osg/Vec3>
#include <osg/Vec4>
#include "actorbase.h"
#include "qsignalslotcenter_global.h"

namespace QSignalSlotCenter
{
	class QSIGNALSLOTCENTER_EXPORT CreateDeleteActorData : public osg::Referenced 
	{
	public:
		CreateDeleteActorData() {};
		virtual ~CreateDeleteActorData() {};
		QVector<osg::ref_ptr<CoreBase::ActorBase>> _objectVector;
		QVector<osg::ref_ptr<CoreBase::ActorBase>> _targetActorVector;
	};

	class QSIGNALSLOTCENTER_EXPORT PropertyTypeData : public osg::Referenced 
	{
	public:
		enum PropertyDataType
		{
			Property_String,
			Property_Vec2f,
			Property_Vec2d,
			Property_Vec3f,
			Property_Vec3d,
			Property_Vec4f,
		};
		PropertyTypeData(QVector<CoreBase::ActorBase*> objectvector,QVector<QString> oldvector,QVector<QString> newvector,
			QString propertyname):_propertyName(propertyname),
		  _oldStringVector(oldvector),_newStringVector(newvector),_propertyDataType(Property_String),_objectVector(objectvector)
		  {}
		  PropertyTypeData(QVector<CoreBase::ActorBase*> objectvector,QVector<osg::Vec2d> oldvector,QVector<osg::Vec2d> newvector,
			  QString propertyname):_propertyName(propertyname),
		  _oldVec2d(oldvector),_newVec2d(newvector),_propertyDataType(Property_Vec2d),_objectVector(objectvector)
		  {}
		  PropertyTypeData(QVector<CoreBase::ActorBase*> objectvector,QVector<osg::Vec2f> oldvector,QVector<osg::Vec2f> newvector,
			  QString propertyname):_propertyName(propertyname),
		  _oldVec2f(oldvector),_newVec2f(newvector),_propertyDataType(Property_Vec2f),_objectVector(objectvector)
		  {}
		  PropertyTypeData(QVector<CoreBase::ActorBase*> objectvector,QVector<osg::Vec3f> oldvector,QVector<osg::Vec3f> newvector,
			  QString propertyname):_propertyName(propertyname),
		  _oldVec3f(oldvector),_newVec3f(newvector),_propertyDataType(Property_Vec3f),_objectVector(objectvector)
		  {}
		  PropertyTypeData(QVector<CoreBase::ActorBase*> objectvector,QVector<osg::Vec3d> oldvector,QVector<osg::Vec3d> newvector,
			  QString propertyname):_propertyName(propertyname),
		  _oldVec3d(oldvector),_newVec3d(newvector),_propertyDataType(Property_Vec3d),_objectVector(objectvector)
		  {}
		   PropertyTypeData(QVector<CoreBase::ActorBase*> objectvector,QVector<osg::Vec4f> oldvector,QVector<osg::Vec4f> newvector,
			  QString propertyname):_propertyName(propertyname),
		  _oldVec4f(oldvector),_newVec4f(newvector),_propertyDataType(Property_Vec4f),_objectVector(objectvector)
		  {}
		  QVector<QString> getNewValueToString();
		  QVector<QString> getOldValueToString();
		  QString getPropertyName()
		  {
			  return _propertyName;
		  }
		  QVector<CoreBase::ActorBase*> getObjectVector()
		  {
			  return _objectVector;
		  }
		  virtual ~PropertyTypeData() {};
	private:
		QVector<QString>								_oldStringVector;
		QVector<QString>								_newStringVector;
		QVector<osg::Vec2d>								_oldVec2d;
		QVector<osg::Vec2d>								_newVec2d;
		QVector<osg::Vec2f>								_oldVec2f;
		QVector<osg::Vec2f>								_newVec2f;
		QVector<osg::Vec3f>								_oldVec3f;
		QVector<osg::Vec3f>								_newVec3f;
		QVector<osg::Vec3d>								_oldVec3d;
		QVector<osg::Vec3d>								_newVec3d;
		QVector<osg::Vec4f>								_oldVec4f;
		QVector<osg::Vec4f>								_newVec4f;
		PropertyDataType								_propertyDataType;
		QString											_propertyName;
		QVector<CoreBase::ActorBase*>					_objectVector;
	};

	class QSIGNALSLOTCENTER_EXPORT PropertyEditorCommand:public CommandBase
	{
	public:
		PropertyEditorCommand(int action,QUndoCommand *parent = 0,const QString& text = "");
		virtual ~PropertyEditorCommand(void);
	public:
		void setPropertyTypeDataObject(osg::ref_ptr<PropertyTypeData> data);
		virtual QString getImageFilePath(){return "";}
		virtual QString getStatusTip(){return "";}
		virtual QString getToolTip(){return "";}
		virtual bool canRedo(){return true;}
		virtual void redo();
		virtual void undo();
	private:
		void DoUndoRedo();
	private:
		osg::ref_ptr<PropertyTypeData>		_propertyTypeData;
	};

	class QSIGNALSLOTCENTER_EXPORT CreateDeleteActorCommand:public CommandBase
	{
	public:
		CreateDeleteActorCommand(int action,QUndoCommand *parent = 0,const QString& text = "");
		~CreateDeleteActorCommand(void);
	public:	
		void setCreateActorData(osg::ref_ptr<CreateDeleteActorData> data);
			//ActorProxyRefPtrVector vec,ActorProxyRefPtrVector targetactorvec,const QString& type);
		virtual QString getImageFilePath(){return "";}
		virtual QString getStatusTip(){return "";}
		virtual QString getToolTip(){return "";}
		virtual bool canRedo(){return true;}
		virtual void redo();
		virtual void undo();
	private:
		osg::ref_ptr<CreateDeleteActorData>		_cdActorData;
	};

	/*class QSIGNALSLOTCENTER_EXPORT CHTSelectProxyCommand:public CHTCommand
	{
	public:
		CHTSelectProxyCommand(int action,QUndoCommand *parent = 0,const QString& text = "");
		~CHTSelectProxyCommand();
	public:
		void setSelectActorProxiesVec(std::vector<dtDAL::ActorProxy*> oldvec,std::vector<dtDAL::ActorProxy*> oldparentvec,
			std::vector<dtDAL::ActorProxy*> newvec,std::vector<dtDAL::ActorProxy*> newparentvec,const QString& type);
		virtual QString GetImageFilePath();
		virtual QString GetStatusTip();
		virtual QString GetToolTip();
		virtual bool CanRedo();
		virtual void redo();
		virtual void undo();
	private:
		std::vector<dtDAL::ActorProxy*> _selectedProxiesVec;
		std::vector<dtDAL::ActorProxy*> _selectedProxiesParentVec;
		std::vector<dtDAL::ActorProxy*> _oldSelectedProxiesVec;
		std::vector<dtDAL::ActorProxy*> _oldSelectedProxiesParentVec;
		QString _type;
	};

	class QSIGNALSLOTCENTER_EXPORT CHTDeleteActorProxyCommand:public CHTCommand
	{
	public:
		CHTDeleteActorProxyCommand(int action,QUndoCommand *parent = 0,const QString& text = "");
		~CHTDeleteActorProxyCommand(void);
	public:	
		void addDeleteActorProxiesVec(ActorProxyRefPtrVector vec,ActorProxyRefPtrVector targetactorvec,const QString& type);
		virtual QString GetImageFilePath();
		virtual QString GetStatusTip();
		virtual QString GetToolTip();
		virtual bool CanRedo();
		virtual void redo();
		virtual void undo();
	private:
		std::vector<dtCore::RefPtr<DeleteProxyData>> _deleteDataVec;
	};
*/
	/*class QSIGNALSLOTCENTER_EXPORT CHTPropertyRenamedCommand:public CHTCommand
	{
	public:
		CHTPropertyRenamedCommand(ChangeEvent* pChangEvent, QUndoCommand *parent = 0);
		virtual ~CHTPropertyRenamedCommand(void);
	public:	
		virtual QString GetCommandCategory();
		virtual QString GetImageFilePath();
		virtual QString GetStatusTip();
		virtual QString GetToolTip();
		virtual bool    IsBackGround();
		virtual bool    CanRedo();
		virtual void redo();
		virtual void undo();
		void  SetFirstDoNothing(bool bFirstDoNothing);
	private:
		void DoUndoRedo();
	private:
		dtCore::RefPtr<ChangeEvent> m_ChangeEvent;
		bool    m_bFirstDoNothing;
		bool    m_bFirstRedo;
	};
	*/
}